//
//  RITLSystemSettingVisitor.m
//  QDMetroClient
//
//  Created by YueWen on 2019/1/21.
//  Copyright © 2019 YueWen. All rights reserved.
//

#import "RITLSystemSettingVisitor.h"

@implementation RITLSystemSettingVisitor

+ (void)visitSystemSettingWithType:(RITLSystemSettingType)type {
    
    //TODO: iOS10 跳转到应用设置界面
    NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
    if (@available(iOS 10.0,*)) {
        if ([[UIApplication sharedApplication] canOpenURL:url]) {
            [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {}];
        }
        return;
    }
    
    //TODO: iOS10 之前  跳入专项的设置界面
    if([UIApplication.sharedApplication canOpenURL:url]){
        [[UIApplication sharedApplication] openURL:url];
    }
}

@end
